﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Threading;
using System.IO.IsolatedStorage;
using HtmlExtractor;

namespace SlTest
{
    public static class UriSource
    {
        public static string GetSource(string uri)
        {
           
            using (TextReader streamReader = new StreamReader(uri))
            {
                return streamReader.ReadToEnd();
            }
        }
       
        public static void GetOnlineSource(string absoluteUri,DownloadStringCompletedEventHandler d)
        {
            
            WebClient wc = new WebClient();
            wc.Encoding = new Gb2312Encoding();//.GetEncoding("gbk");
            wc.DownloadStringAsync(new Uri(absoluteUri));
            wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(d);
        }
       
    }
   
}
